var WxParse = require('../../wxParse/wxParse.js');
const app = getApp();
const API = require('../../common/constant');
const util = require('../../utils/util');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    article: ''
  },
  getInfo: function (fileKey) {
    let that = this;
    util.http({
      url: API.URL.INFORMATION.FIND_INFORMATIONBYID,
      data: {
        fileKey: fileKey
      },
      success(res) {
        console.log(res);
        let infos = res.data.bussData;
        let data = infos.gmtCreated.split(' ');
        infos.gmtCreated = data[0];
        that.setData({
          infos: infos
        })
        let temp = WxParse.wxParse('article', 'html', that.data.infos.content, that, 5);
      },
      fail(res) {
        console.log(res);
        app.showUserInfo('获取资讯详情失败', 'none', 1500)
      }
    })
  },
  /**
  * 生命周期函数--监听页面加载
  */
  onLoad: function (options) {
    this.getInfo(options.filekey)
  }
})